﻿@model IList<BlogPostYearModel>
@using Nop.Web.Models.Blogs;
@if (Model.Count > 0)
{
    <div class="panel panel-default side-nav side-nav-category">
        <div class="panel-heading">
            <strong>@T("Blog.Archive")</strong>
        </div>
        <div class="panel-body">
            <div class="panel-group" id="blog-month-list accordion">
                @foreach (var yearItem in Model)
                {
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#blog-year-@(yearItem.Year)"><strong>@(yearItem.Year)</strong></a>
                            </h4>
                        </div>
                   
                        <div class="panel-collapse collapse" id="blog-year-@(yearItem.Year)">
                            @foreach (var monthItem in yearItem.Months)
                            {
                                <div class="panel-body"><a href="@Url.RouteUrl("BlogByMonth", new { month = yearItem.Year + "-" + monthItem.Month })">@(new DateTime(yearItem.Year, monthItem.Month, 1).ToString("MMMM"))
                                                            (@(monthItem.BlogPostCount))</a> </div>
                            }
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>

}